package com.xqy.wexmini.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.netty.channel.WriteBufferWaterMark;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;


@ApiModel(value = "用户信息")
@Data
public class User implements Serializable {

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;


    @TableField("user_name")//对应表中得字段名称
    private String userName;

    @JsonIgnore//不返回给前端该值得json序列化
    private String password;

    /**
     * 微信openId
     */
    @TableField("open_id")
    private String openId;

    /**
     * 用户昵称
     */
    @TableField("nick_name")
    private String nickName;

    /**
     * 性别 0-未知 1-male,2-female
     */
    private Integer gender;

    /**
     * 头像地址
     */
    @TableField("avatar_url")
    private String avatarUrl;

    @TableField("union_id")
    private String unionId;

    private String country;

    private String province;

    private String city;

    private String language;

    private String email;

    private String phone;

    private String remarks;

    private Boolean enabled;

    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)//创建时自动填充
    private Date createTime;

    @JsonIgnore
    @TableField(fill= FieldFill.INSERT_UPDATE)//创建与修改时自动填充
    private Date updateTime;


    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", userName='" + userName + '\'' +

                ", nickName='" + nickName + '\'' +

                '}';
    }
}
